home *** CD-ROM | disk | FTP | other *** search
/ HAM Radio 1997 / HAM Radio 1997.iso / vcls / wsanet8a / wsanet / src / netclnt.bak < prev    next >
Text File  |  1996-04-08  |  20KB  |  881 lines

  1. /* NETCLNT.H - NetClient's Header file */
  2.  
  3.    /* Resource #defines */
  4. #define IDBMP_CLIENT     8000
  5. #define IDBMP_CLIENTDOWN 8001
  6. #define ID_CLIENTMONO 8003
  7. #define IDBMP_CLIENTEGA  8006
  8. #define IDDLG_ABOUT      200
  9.  
  10. #define IDTIME_TIMEOUT   1
  11. #define IDTIME_FLUSH     2
  12.  
  13. #ifndef IDOK
  14. #define IDOK 1
  15. #endif
  16.  
  17.     /* Internal message #defines */
  18. #define CM_NETACTIVITY   WM_USER+1
  19.  
  20. #ifdef DESIGN_TIME
  21. #define CM_OPENABOUTDLG  WM_USER+2
  22.  
  23. #define CLASS_ABOUTPOPUP "AboutWSetClass"
  24. #define CONTROLNAME      "WSANet VBX"
  25. #define WSANET_HELPFILE  "wsanet.hlp"
  26.  
  27. #define STRING_ABOUTTEXT "About NetClient"
  28. #define STRING_WRITEONLY "*Write only*"
  29. #endif // DESIGN_TIME
  30.  
  31.  
  32.     // All of the property indicies
  33. // Enumerations ofProperties in NetClient_Properties[]
  34. // MUST BE IN SAME ORDER
  35. enum enum_netclient_props
  36. {
  37.    /* Standard properties */
  38.  
  39.  IPROP_NECLIENT_CTLNAME,
  40.  IPROP_NETCLIENT_PARENT,
  41.  IPROP_NETCLIENT_INDEX,
  42.  IPROP_NETCLIENT_TOP,
  43.  IPROP_NETCLIENT_LEFT,
  44.  IPROP_NETCLIENT_TAG,
  45.  IPROP_NETCLIENT_HWND,
  46.     /* Custom properties */
  47.  IPROP_NETCLIENT_ABOUT,
  48.  IPROP_NETCLIENT_SOCKET,
  49.  IPROP_NETCLIENT_HOSTNAME,
  50.  IPROP_NETCLIENT_HOSTADDR,
  51.  IPROP_NETCLIENT_LOCALPORT,
  52.  IPROP_NETCLIENT_REMOTEPORT,
  53.  IPROP_NETCLIENT_RECVLINE,
  54.  IPROP_NETCLIENT_ , IPROP_NTCL_LINEDELIMITER,
  55.  IPROP_NETCLIENT_RECVCOUNT,
  56.  IPROP_NETCLIENT_SENDCOUNT,
  57.  IPROP_NETCLIENT_RECVSIZE,
  58.  IPROP_NETCLIENT_SENDSIZE,
  59. PROP_NETCLIENT_RECVTHRESHOLD,
  60.  IPROP_NETCLIENT_SENDTHRESHOLD,
  61.  IPROP_NETCLIENT_CONNECT,
  62.  IPROP_NETCLIENT_TIMEOUT,
  63.  IPROP_NETCLIENT_ERRORNUMBER,
  64.  IPROP_NETCLIENT_ERRORMESSAGE,
  65.  IPROP_NETCLIENT_LOCALSERVICE,    // Change from alpha 2!
  66.  IPROP_NETCLIENT_REMOTESERVICE,
  67.  IPROP_NETCLIENT_VERSION,         // Change from alpha 6!
  68.  IPROP_NETCLIENT_DEBUG,
  69.  IPROP_NETCLIENT_HOSTALIASCOUNT,
  70.  IPROP_NETCLIENT_HOSTALIASLIST,
  71.  IPROP_NETCLIENT_HOSTADDRESSCNT,
  72.  IPROP_NETCLIENT_HOSTADDRESSLIST,
  73.  IPROP_NETCLIENT_NONE1,           // Expansion for 8 properties!
  74.  IPROP_NETCLIENT_NONE2,           // (pre VB2.0 properties that is)
  75.  IPROP_NETCLIENT_NONE3,
  76.  IPROP_NETCLIENT_NONE4,
  77.  IPROP_NETCLIENT_NONE5,
  78.  IPROP_NETCLIENT_NONE6,
  79.  IPROP_NETCLIENT_NONE7,
  80.  IPROP_NETCLIENT_NONE8,
  81.      // These three are only available to VB2.00+ apps
  82.  IPROP_NETCLIENT_RECVBLOCK,
  83.  IPROP_NETCLIENT_SENDBLOCK,
  84.  IPROP_NETCLIENT_BLOCK
  85. };
  86.  
  87. typedef struct tagONERRORPARMS
  88. {
  89.  SHORT FAR *ErrorNumber;
  90.  LPVOID Index;
  91. } ONERRORPARMS;
  92.  
  93.  
  94. // Enumerate the Events in NetClientEvents[]
  95. // MUST BE IN SAME ORDER (See INIT.C)
  96. enum enum_events
  97. {
  98.  IEVENT_NETCLIENT_ONCONNECT,
  99.  IEVENT_NETCLIENT_ONRECV,
  100.  IEVENT_NETCLIENT_ONSEND,
  101.  IEVENT_NETCLIENT_ONCLOSE,
  102.  IEVENT_NETCLIENT_ONTIMEOUT,
  103.  IEVENT_NETCLIENT_ONERROR
  104. };
  105.  
  106. // Errors sent back to VB (and .RC identifiers)
  107. #define ERR_None                0
  108.  
  109. // These are sent ONLY to the OnError Event!
  110. #define ERR_Base                100
  111. #define ERR_NoWinSock           100
  112. #define ERR_BadVersion          101
  113. #define ERR_NotConn             102
  114. #define ERR_AlreadyConn         103
  115. #define ERR_RecvNotEmpty        104
  116. #define ERR_SendOverFlow        105
  117. #define ERR_BadHostAddr         106
  118. #define ERR_NoTimers            107
  119. #define ERR_InvalidString       108
  120. #define ERR_HostUnknown         109
  121. #define ERR_RecvBuffer          110
  122. #define ERR_SendBuffer          111
  123. #define ERR_CantSet             112
  124. #define ERR_Last                113
  125. #define ERR_BadSocket           114
  126. #define ERR_BufferNotEmpty      115
  127. #define NETBASEERR              200
  128.  
  129. // VB Errors
  130. #define ERR_OUTOFMEMORY         7
  131. #define ERR_BADVBINDEX          381
  132. #define ERR_READONLY            383
  133. #define ERR_WRITEONLY           394
  134.  
  135. #define VB_ERROR_BASE           20000
  136. #define VB_ERROR_NOCONNECTION   20000
  137.  
  138.     /* Miscellaneous #defines for defaults and odd variables */
  139. #define WSA_VERSION_NEEDED  0x0101
  140.  
  141. // Defaults for properties
  142. #define DEFAULT_TIMEOUT       30000
  143. #define DEFAULT_PORT          2600
  144. #define DEFAULT_RECVSIZE      8192
  145. #define DEFAULT_SENDSIZE      4096
  146. #define DEFAULT_RECVTHRESHOLD 1
  147. #define DEFAULT_SENDTHRESHOLD 0
  148.  
  149. // No more than 20 host aliases or addresses!
  150. #define MAX_HOSTTABLESIZE     20
  151.  
  152. typedef struct tagHOSTTABLE
  153. {
  154.  int iHostCount;
  155.  ATOM aHost[MAX_HOSTTABLESIZE];
  156. } HOSTTABLE;
  157.  
  158.     /* PROPERTIES */
  159. typedef struct tagNETCLIENT
  160. { // When in Rome...
  161.  ATOM  aHostName;
  162.  ATOM  aHostAddr;
  163.  
  164.  SHORT sRemotePort;      // remote port to connect to
  165.  SHORT sLocalPort;       // local port to connect to
  166.  
  167.  HSZ   hszLineDelimiter; // Delimiter for Lines
  168.  HSZ   hszRawLineDelimiter; // wsprint() parsed LineDelimiter
  169.  
  170.  HLSTR hlRecvBlock;      // These CAN have embedded Zeros (VB2.00+ only)
  171.  HLSTR hlSendBlock;      // Everything is sent "raw" - perfect for binary
  172.  
  173.  SHORT sRecvThreshold;   // Threshold before which OnRecv is called
  174.  SHORT sSendThreshold;   // Low-water mark before OnSend is triggered
  175.  SHORT sRecvSize;        // Total size of RecvBuffer
  176.  SHORT sSendSize;        // Total size of SendBuffer
  177.  SHORT sRecvCount;       // Current bytes waiting processing
  178.  SHORT sSendCount;       // Current bytes waiting to be sent
  179.  BOOL  bConnect;         // TRUE if connection exists, FALSE otherwise
  180.  SHORT sTimeOut;         // Countdown to next timeout
  181.  
  182.  SHORT sErrorNumber;     // ErrorNumber for OnError
  183.  
  184.     // elements not used, just markers (to make VB happy)
  185.  HSZ   hszAbout;
  186.  
  187.     // "Hidden" properties - nonpublic (OOP! Eeek!)
  188.  SOCKET sSocket;      // Socket of any connection
  189.  SOCKADDR_IN saHost;  // Address structure to Host
  190.  
  191.  BOOL   fCanSend;     // Flag: Enabled during FD_WRITE after WOULDBLOCK
  192.  HANDLE hRecvBuffer;  // handle to the receive buffer
  193.  HANDLE hSendBuffer;  // handle ro the send buffer
  194.  HANDLE hRecvTemp;    // handle to the temporary receive space
  195.  HANDLE hSendTemp;    // handle to the temporary send space
  196.  LPSTR  lpRecvBuffer; // locked pointer to the receive buffer
  197.  LPSTR  lpSendBuffer; // locked pointer to the send buffer
  198.  LPSTR  lpRecvTemp;   // locked pointer to the temporary receive space
  199.  LPSTR  lpSendTemp;   // locked pointer to the temporary send space
  200.  
  201.  SHORT  sRecvTempSize;// size of temporary receive space
  202.  SHORT  sSendTempSize;// size of temporary send space
  203.  SHORT  sTimeOutStore;// Storage for resetting TimeOut when it gets to 0
  204.  
  205.  HOSTTABLE htHostAddressList;
  206.  HOSTTABLE htHostAliasList;
  207. } NETCLIENT;
  208.  
  209. typedef NETCLIENT FAR * LPNETCLIENT;
  210.  
  211.  
  212. #ifdef WSANet_C
  213.  
  214.     // Anti-Ugly code macro
  215. #define VBGETOFFSET(arg) ((USHORT)&(((NETCLIENT *)0)->arg))
  216.  
  217.     // About property - open up the About dialog box
  218. PROPINFO Property_About =
  219. {
  220.  "About",
  221.  DT_SHORT | PF_fGetData | PF_fSetData | PF_fNoRuntimeW
  222.  | PF_fGetHszMsg | PF_fNoInitDef,
  223.  0,
  224.  0, 0, NULL, 0
  225. };
  226.  
  227.     // Socket property - the actual socket
  228. PROPINFO Property_Socket =
  229. {
  230.  "Socket",
  231.  DT_SHORT | PF_fGetData | PF_fSetMsg | PF_fNoInitDef,
  232.  VBGETOFFSET(sSocket),
  233.  0, 0, NULL, 0
  234. };
  235.  
  236.     // HostName property - DNS name of HostIP
  237. // Changing this will alter HostIP to the appropriate
  238. // internet address in dotted string notation.
  239. // You will not have to be connected.
  240. PROPINFO Property_HostName =
  241. {
  242.  "HostName",
  243.  DT_HSZ | PF_fGetMsg | PF_fSetMsg | PF_fNoInitDef,
  244.  0,
  245.  0, 0, NULL, 0
  246. };
  247.  
  248.     // HostAddr property - IP address of HostName
  249. // Changing this will alter HostName to the appropriate
  250. // name.
  251. // You will not have to be connected.
  252. PROPINFO Property_HostAddr =
  253. {
  254.  "HostAddr",
  255.  DT_HSZ | PF_fGetMsg | PF_fSetMsg | PF_fNoInitDef,
  256.  0,
  257.  0, 0, NULL, 0
  258. };
  259.  
  260.     // LocalPort Property - TCP port on the Local host
  261. PROPINFO Property_LocalPort =
  262. {
  263.  "LocalPort",
  264.  DT_SHORT | PF_fGetData | PF_fSetMsg |
  265.      PF_fNoInitDef,
  266.  VBGETOFFSET(sLocalPort),
  267.  0, 0, NULL, 0
  268. };
  269.  
  270.     // LocalService Property - Service name for LocalPort
  271. PROPINFO Property_LocalService =
  272. {
  273.  "LocalService",
  274.  DT_HSZ | PF_fGetMsg | PF_fSetMsg | PF_fNoInitDef,
  275.  0,          // DUMMY! (we handle set/get with messages)
  276.  0, 0, NULL, 0
  277. };
  278.  
  279.     // RemotePort Property - TCP port on the remote host
  280. PROPINFO Property_RemotePort =
  281. {
  282.  "RemotePort",
  283.  DT_SHORT | PF_fGetData | PF_fSetMsg |
  284.     PF_fSaveData | PF_fDefVal,
  285.  VBGETOFFSET(sRemotePort),
  286.  0, DEFAULT_PORT, NULL, 0
  287. };
  288.  
  289.     // RemoteService Property - Service name for RemotePort
  290. PROPINFO Property_RemoteService =
  291. {
  292.  "RemoteService",
  293.  DT_HSZ | PF_fGetMsg | PF_fSetMsg | PF_fNoInitDef,
  294.  0,
  295.  0, 0, NULL, 0
  296. };
  297.  
  298.     // RecvLine Property
  299. PROPINFO Property_RecvLine =
  300. {
  301.  "RecvLine",
  302.  DT_HSZ | PF_fGetMsg | PF_fSetMsg |
  303.     PF_fNoInitDef,
  304.  0,
  305.  0, 0, NULL, 0
  306. };
  307.  
  308.     // SendLine Property - not shown in dialog
  309. // SetMsg/SetData means that VB will set the element AND tell us
  310. PROPINFO Property_SendLine =
  311. {
  312.  "SendLine",
  313.  DT_HSZ | PF_fGetMsg | PF_fSetMsg |
  314.     PF_fNoInitDef | PF_fGetHszMsg,
  315.  0,
  316.  0, 0, NULL, 0
  317. };
  318.  
  319.         // Line Property - not visible in design time
  320. // This is the "default" property for this control
  321. // Get: same as Get on RecvLine
  322. // Set: same as Set on SendLine
  323. // Reason: Allows 'string = NetClient1' and 'NetClient1 = "output"'
  324. PROPINFO Property_Line =
  325. {
  326.  "Line",
  327.  DT_HSZ | PF_fGetMsg | PF_fSetMsg |
  328.     PF_fNoInitDef | PF_fNoShow,
  329.  0,              // Dummy, dummy!
  330.  0, 0, NULL, 0
  331. };
  332.  
  333.     // RecvBlock Property
  334. PROPINFO Property_RecvBlock =
  335. {
  336.  "RecvBlock",
  337.  DT_HLSTR | PF_fGetMsg | PF_fSetMsg    |
  338.     PF_fNoInitDef,
  339.  0,
  340.  0, 0, NULL, 0
  341. };
  342.  
  343.     // SendBlock Property - not shown in dialog
  344. PROPINFO Property_SendBlock =
  345. {
  346.  "SendBlock",
  347.  DT_HLSTR | PF_fGetData | PF_fSetMsg |
  348.     PF_fNoInitDef | PF_fGetHszMsg,
  349.  VBGETOFFSET(hlSendBlock),
  350.  0, 0, NULL, 0
  351. };
  352.  
  353.         // Block Property - not visible in design time
  354. // This is a convenience property for this control
  355. // Get: same as Get on RecvBlock
  356. // Set: same as Set on SendBlock
  357. // Reason: Allows single property to do binary input and output
  358. PROPINFO Property_Block =
  359. {
  360.  "Block",
  361.  DT_HSZ | PF_fGetMsg | PF_fSetMsg |
  362.     PF_fNoInitDef | PF_fNoShow,
  363.  0,              // Dummy, dummy!
  364.  0, 0, NULL, 0
  365. };
  366.  
  367.     // LineDelimiter Property
  368. PROPINFO Property_LineDelimiter =
  369. {
  370.  "LineDelimiter",
  371.  DT_HSZ | PF_fGetData | PF_fSetData | PF_fSetMsg |
  372.     PF_fSaveData,
  373.  VBGETOFFSET(hszLineDelimiter),
  374.  0, 0, NULL, 0
  375. };
  376.  
  377.  
  378.     // RecvCount Property - the valid bytes in RecvBuffer
  379. PROPINFO Property_RecvCount =
  380. {
  381.  "RecvCount",
  382.  DT_SHORT | PF_fGetMsg | PF_fSetMsg |
  383.     PF_fNoInitDef,
  384.  VBGETOFFSET(sRecvCount),
  385.  0, 0, NULL, 0
  386. };
  387.  
  388.     // SendCount Property - the valid bytes in SendBuffer
  389. // not shown in dialog.
  390. PROPINFO Property_SendCount =
  391. {
  392.  "SendCount",
  393.  DT_SHORT | PF_fGetMsg | PF_fSetMsg |
  394.     PF_fNoInitDef,
  395.  VBGETOFFSET(sSendCount),
  396.  0, 0, NULL, 0
  397. };
  398.  
  399.     // RecvSize Property - the size of the RecvBuffer
  400. PROPINFO Property_RecvSize =
  401. {
  402.  "RecvSize",
  403.  DT_SHORT | PF_fGetData | PF_fSetMsg |
  404.     PF_fSaveData | PF_fDefVal,
  405.  VBGETOFFSET(sRecvSize),
  406.  0, DEFAULT_RECVSIZE, NULL, 0
  407. };
  408.  
  409.     // SendSize Property - the size of the SendBuffer
  410. PROPINFO Property_SendSize =
  411. {
  412.  "SendSize",
  413.  DT_SHORT | PF_fGetData | PF_fSetMsg |
  414.     PF_fSaveData | PF_fDefVal,
  415.  VBGETOFFSET(sSendSize),
  416.  0, DEFAULT_SENDSIZE, NULL, 0
  417. };
  418.  
  419.     // RecvThreshold Property - cutoff before Event noticed
  420. // If data never passes this set threshold, no OnRecv is generated
  421. PROPINFO Property_RecvThreshold =
  422. {
  423.  "RecvThreshold",
  424.  DT_SHORT | PF_fSetData | PF_fGetData |
  425.     PF_fSaveData | PF_fDefVal,
  426.  VBGETOFFSET(sRecvThreshold),
  427.  0, DEFAULT_RECVTHRESHOLD, NULL, 0
  428. };
  429.  
  430.     // SendThreshold Property - cutoff before Event noticed
  431. // If data never drops below this set threshold, no OnSend is generated
  432. PROPINFO Property_SendThreshold =
  433. {
  434.  "SendThreshold",
  435.  DT_SHORT | PF_fSetData | PF_fGetData |
  436.     PF_fSaveData | PF_fDefVal,
  437.  VBGETOFFSET(sSendThreshold),
  438.  0, DEFAULT_SENDTHRESHOLD, NULL, 0
  439. };
  440.  
  441.     // Connect Property - Initiates connection
  442. // Remains false until connection exists, then Event
  443. // is triggered.
  444. PROPINFO Property_Connect =
  445. {
  446.  "Connect",
  447.  DT_BOOL | PF_fSetMsg | PF_fGetData |
  448.     PF_fNoInitDef,
  449.  VBGETOFFSET(bConnect),
  450.  0, FALSE, NULL, 0
  451. };
  452.  
  453.     // TimeOut Property - timeout in milliseconds
  454. // Do not exceed 32768 (~32 seconds)
  455. PROPINFO Property_TimeOut =
  456. {
  457.  "TimeOut",
  458.  DT_SHORT | PF_fSetMsg | PF_fGetData |
  459.     PF_fSaveData | PF_fDefVal,
  460.  VBGETOFFSET(sTimeOut),
  461.  0, 0, NULL, 0
  462. };
  463.  
  464.     // ErrorNumber Property
  465. // Hold the last WSAGetLastError() or a NetClient specific error
  466. PROPINFO Property_ErrorNumber =
  467. {
  468.  "ErrorNumber",
  469.  DT_SHORT | PF_fSetData | PF_fGetData |
  470.     PF_fNoInitDef,
  471.  VBGETOFFSET(sErrorNumber),
  472.  0, 0, NULL, 0
  473. };
  474.  
  475.     // ErrorMessage Property
  476. // Hold the last ErrorNumber's error message
  477. PROPINFO Property_ErrorMessage =
  478. {
  479.  "ErrorMessage",
  480.  DT_HSZ | PF_fSetMsg | PF_fGetMsg |
  481.     PF_fNoInitDef,
  482.  0,
  483.  0, 0, NULL, 0
  484. };
  485.  
  486.     // Version Property
  487. // Show the Version information.
  488. PROPINFO Property_Version =
  489. {
  490.  "Version",
  491.  DT_HSZ | PF_fSetMsg | PF_fGetMsg |
  492.     PF_fNoInitDef,
  493.  0,
  494.  0, 0, NULL, 0
  495. };
  496.  
  497.     // Debug Property
  498. // Show the Debug sockopt() state
  499. PROPINFO Property_Debug =
  500. {
  501.  "Debug",
  502.  DT_BOOL | PF_fSetMsg | PF_fGetMsg |
  503.     PF_fNoInitDef,
  504.  0,
  505.  0, 0, NULL, 0
  506. };
  507.  
  508.     // HostAliasCount Property
  509. // Report the number of aliases for HostName
  510. // (index into HostAliasList())
  511. PROPINFO Property_HostAliasCount =
  512. {
  513.  "HostAliasCount",
  514.  DT_SHORT | PF_fSetMsg | PF_fGetMsg |
  515.     PF_fNoInitDef,
  516.  0,
  517.  0, 0, NULL, 0
  518. };
  519.  
  520.     // HostAliasList Property
  521. // References array of aliases to HostName
  522. // (index with HostAliasCount)
  523. PROPINFO Property_HostAliasList =
  524. {
  525.  "HostAliasList",
  526.  DT_HSZ | PF_fPropArray | PF_fNoShow | PF_fSetMsg |
  527.     PF_fGetMsg | PF_fNoInitDef,
  528.  0,
  529.  0, 0, NULL, 0
  530. };
  531.  
  532.     // HostAddressCount Property
  533. // Report the number of addresses for HostName
  534. // (index into HostAddressList())
  535. PROPINFO Property_HostAddressCount =
  536. {
  537.  "HostAddressCount",
  538.  DT_SHORT | PF_fSetMsg | PF_fGetMsg |
  539.     PF_fNoInitDef,
  540.  0,
  541.  0, 0, NULL, 0
  542. };
  543.  
  544.     // HostAddressList Property
  545. // References array of aliases to HostName
  546. // (index with HostAddressCount)
  547. PROPINFO Property_HostAddressList =
  548. {
  549.  "HostAddressList",
  550.  DT_HSZ | PF_fPropArray | PF_fNoShow | PF_fSetMsg |
  551.     PF_fGetMsg | PF_fNoInitDef,
  552.  0,
  553.  0, 0, NULL, 0
  554. };
  555.  
  556.  
  557.     // All of the VB1.00 properties - in dialog order
  558. PPROPINFO NetClient_Properties_VB1[] =
  559. {
  560.  PPROPINFO_STD_CTLNAME,
  561.  PPROPINFO_STD_PARENT,
  562.  PPROPINFO_STD_INDEX,
  563.  PPROPINFO_STD_TOP,
  564.  PPROPINFO_STD_LEFT,
  565.  PPROPINFO_STD_TAG,
  566.  PPROPINFO_STD_HWND,
  567.  &Property_About,
  568.  &Property_Socket,
  569.  &Property_HostName,
  570.  &Property_HostAddr,
  571.  &Property_LocalPort,
  572.  &Property_RemotePort,
  573.  &Property_RecvLine,
  574.  &Property_SendLine,
  575.  &Property_Line,
  576.  &Property_LineDelimiter,
  577.  &Property_RecvCount,
  578.  &Property_SendCount,
  579.  &Property_RecvSize,
  580.  &Property_SendSize,
  581.  &Property_RecvThreshold,
  582.  &Property_SendThreshold,
  583.  &Property_Connect,
  584.  &Property_TimeOut,
  585.  &Property_ErrorNumber,
  586.  &Property_ErrorMessage,
  587.  &Property_LocalService,
  588.  &Property_RemoteService,
  589.  &Property_Version,
  590.  &Property_Debug,
  591.  &Property_HostAliasCount,
  592.  &Property_HostAliasList,
  593.  &Property_HostAddressCount,
  594.  &Property_HostAddressList,
  595.  NULL
  596. };
  597.  
  598.     // All of the VB2.00 properties - in dialog order
  599. PPROPINFO NetClient_Properties_VB2[] =
  600. {
  601.  PPROPINFO_STD_NAME,
  602.  PPROPINFO_STD_PARENT,
  603.  PPROPINFO_STD_INDEX,
  604.  PPROPINFO_STD_TOPNORUN,
  605.  PPROPINFO_STD_LEFTNORUN,
  606.  PPROPINFO_STD_TAG,
  607.  PPROPINFO_STD_HWND,
  608.  &Property_About,
  609.  &Property_Socket,
  610.  &Property_HostName,
  611.  &Property_HostAddr,
  612.  &Property_LocalPort,
  613.  &Property_RemotePort,
  614.  &Property_RecvLine,
  615.  &Property_SendLine,
  616.  &Property_Line,
  617.  &Property_LineDelimiter,
  618.  &Property_RecvCount,
  619.  &Property_SendCount,
  620.  &Property_RecvSize,
  621.  &Property_SendSize,
  622.  &Property_RecvThreshold,
  623.  &Property_SendThreshold,
  624.  &Property_Connect,
  625.  &Property_TimeOut,
  626.  &Property_ErrorNumber,
  627.  &Property_ErrorMessage,
  628.  &Property_LocalService,
  629.  &Property_RemoteService,
  630.  &Property_Version,
  631.  &Property_Debug,
  632.  &Property_HostAliasCount,
  633.  &Property_HostAliasList,
  634.  &Property_HostAddressCount,
  635.  &Property_HostAddressList,
  636.  PPROPINFO_STD_NONE,        // Expansion room!
  637.  PPROPINFO_STD_NONE,
  638.  PPROPINFO_STD_NONE,
  639.  PPROPINFO_STD_NONE,
  640.  PPROPINFO_STD_NONE,
  641.  PPROPINFO_STD_NONE,
  642.  PPROPINFO_STD_NONE,
  643.  PPROPINFO_STD_NONE,
  644.      // These three are available only to VB2.00 apps
  645.  &Property_RecvBlock,
  646.  &Property_SendBlock,
  647.  &Property_Block,
  648.  NULL
  649. };
  650.  
  651.  
  652. // Parameters to the Events.
  653. // Currently all are (), due to random unexplained
  654. // GPFs during testing. See "misc.h" to see what
  655. // was trimmed.
  656.  
  657. EVENTINFO Event_OnConnect =
  658. {
  659.  "OnConnect",
  660.  0,
  661.  0,
  662.  NULL,
  663.  NULL
  664. };
  665.  
  666. EVENTINFO Event_OnRecv =
  667. {
  668.  "OnRecv",
  669.  0,
  670.  0,
  671.  NULL,
  672.  NULL
  673. };
  674.  
  675.     // The OnSend Event structure
  676. EVENTINFO Event_OnSend =
  677. {
  678.  "OnSend",
  679.  0,
  680.  0,
  681.  NULL,
  682.  NULL
  683. };
  684.  
  685.     // The OnClose Event structure
  686. EVENTINFO Event_OnClose =
  687. {
  688.  "OnClose",
  689.  0,
  690.  0,
  691.  NULL,
  692.  NULL
  693. };
  694.  
  695. EVENTINFO Event_OnTimeOut =
  696. {
  697.  "OnTimeOut",
  698.  0,
  699.  0,
  700.  NULL,
  701.  NULL
  702. };
  703.  
  704.  
  705. WORD Paramtypes_OnError[] = { ET_I2 };
  706.  
  707. EVENTINFO Event_OnError =
  708. {
  709.  "OnError",
  710.  1,
  711.  2,
  712.  Paramtypes_OnError,
  713.  "iErrorNumber As Integer"
  714. };
  715.  
  716. /*
  717. EVENTINFO Event_OnError =
  718. {
  719.  "OnError",
  720.  0,
  721.  0,
  722.  NULL,
  723.  NULL
  724. };
  725. */
  726.     // The NetClient Events listed in order
  727. PEVENTINFO NetClient_Events[] =
  728. {
  729.  &Event_OnConnect,
  730.  &Event_OnRecv,
  731.  &Event_OnSend,
  732.  &Event_OnClose,
  733.  &Event_OnTimeOut,
  734.  &Event_OnError,
  735.  NULL
  736. };
  737.  
  738. #ifdef VB100_CDK
  739.  
  740.     // The MODEL structure for the NetClient control (VB1.00)
  741. MODEL modelNetClient_VB1 =
  742. {
  743.  VB100_VERSION,
  744.  MODEL_fDesInteract | MODEL_fLoadMsg,
  745.  (PCTLPROC)NetClientCtlProc,
  746.  0,
  747.  0L,
  748.  sizeof(NETCLIENT),
  749.  IDBMP_CLIENT,
  750.  "NetClient",
  751.  "NetClient",
  752.  NULL,
  753.  NetClient_Properties_VB1,
  754.  NetClient_Events,
  755.  IPROP_NETCLIENT_LINE,
  756.  IEVENT_NETCLIENT_ONCONNECT,
  757. };
  758.  
  759. #endif /* VB100_CDK */
  760.  
  761.  
  762. #ifdef VB200_CDK
  763.  
  764.     // The MODEL structure for the NetClient control! (VB2.00)
  765. MODEL modelNetClient_VB2 =
  766. {
  767.  VB200_VERSION,
  768.  MODEL_fDesInteract | MODEL_fInvisAtRun | MODEL_fLoadMsg,
  769.  (PCTLPROC)NetClientCtlProc,
  770.  0,
  771.  0L,
  772.  sizeof(NETCLIENT),
  773.  IDBMP_CLIENT,
  774.  "NetClient",
  775.  "NetClient",
  776.  NULL,
  777.  NetClient_Properties_VB2,
  778.  NetClient_Events,
  779.  IPROP_NETCLIENT_LINE,
  780.  IEVENT_NETCLIENT_ONCONNECT,
  781.  IPROP_NETCLIENT_LINE
  782. };
  783.  
  784. #endif /* VB200_CDK */
  785.  
  786.  
  787. #ifdef VB300_CDK
  788.  
  789.     // The MODEL structure for the NetClient control (VB3.00+)
  790. MODEL modelNetClient_VB3 =
  791. {
  792.  VB300_VERSION,
  793.  MODEL_fDesInteract | MODEL_fInvisAtRun | MODEL_fLoadMsg,
  794.  (PCTLPROC)NetClientCtlProc,
  795.  0,
  796.  0L,
  797.  sizeof(NETCLIENT),
  798.  IDBMP_CLIENT,
  799.  "NetClient",
  800.  "NetClient",
  801.  NULL,
  802.  NetClient_Properties_VB2,  // This will most likely change
  803.  NetClient_Events,
  804.  IPROP_NETCLIENT_LINE,
  805.  IEVENT_NETCLIENT_ONCONNECT,
  806.  IPROP_NETCLIENT_LINE,
  807.  WSANET_VERSION
  808. };
  809.  
  810. #endif /* VB300_CDK */
  811.  
  812.     // All of the help "context-id's" are referenced through
  813.     // this table
  814. static WORD wNetClientHelpProps[] =
  815. {
  816.  PROPERTY_NAME,
  817.  PROPERTY_PARENT,
  818.  PROPERTY_INDEX,
  819.  PROPERTY_TOP,
  820.  PROPERTY_LEFT,
  821.  PROPERTY_TAG,
  822.  PROPERTY_HWND,
  823.     /* Custom properties */
  824.  PROPERTY_ABOUT,
  825.  PROPERTY_SOCKET,
  826.  PROPERTY_HOSTNAME,
  827.  PROPERTY_HOSTADDR,
  828.  PROPERTY_LOCALPORT,
  829.  PROPERTY_REMOTEPORT,
  830.  PROPERTY_RECVLINE,
  831.  PROPERTY_SENDLINE,
  832.  PROPERTY_LINE,
  833.  PROPERTY_LINEDELIMITER,
  834.  PROPERTY_RECVCOUNT,
  835.  PROPERTY_SENDCOUNT,
  836.  PROPERTY_RECVSIZE,
  837.  PROPERTY_SENDSIZE,
  838.  PROPERTY_RECVTHRESHOLD,
  839.  PROPERTY_SENDTHRESHOLD,
  840.  PROPERTY_CONNECT,
  841.  PROPERTY_TIMEOUT,
  842.  PROPERTY_ERRORNUMBER,
  843.  PROPERTY_ERRORMESSAGE,
  844.  PROPERTY_LOCALSERVICE,    // Change from alpha 2!
  845.  PROPERTY_REMOTESERVICE,
  846.  PROPERTY_VERSION,
  847.  PROPERTY_DEBUG,
  848.  PROPERTY_HOSTALIASCOUNT,
  849.  PROPERTY_HOSTALIASLIST,
  850.  PROPERTY_HOSTADDRESSCNT,
  851.  PROPERTY_HOSTADDRESSLIST,
  852.  PROPERTY_UNUSED,
  853.  PROPERTY_UNUSED,
  854.  PROPERTY_UNUSED,
  855.  PROPERTY_UNUSED,
  856.  PROPERTY_UNUSED,
  857.  PROPERTY_UNUSED,
  858.  PROPERTY_UNUSED,
  859.  PROPERTY_UNUSED,
  860.      // These three are only available to VB2.00+ apps
  861.  PROPERTY_RECVBLOCK,
  862.  PROPERTY_SENDBLOCK,
  863.  PROPERTY_BLOCK,
  864.  NULL
  865. };
  866.  
  867. static WORD wNetClientHelpEvents[] =
  868. {
  869.  EVENT_ONCONNECT,
  870.  EVENT_ONRECV,
  871.  EVENT_ONSEND,
  872.  EVENT_ONCLOSE,
  873.  EVENT_ONTIMEOUT,
  874.  EVENT_ONERROR,
  875.  NULL
  876. };
  877.  
  878. #endif /* WSANet_C */
  879.  
  880. /* End of NetClnt.H */
  881.